function handles = importCellParametersFromWS(handles)
% importCellParametersFromWS
%
% Requires that you first calculate the cell parameters and
% store them in the appropriate variable in the WS.
% This is done automatically by running the appropriate 
% function from the 'Cell parameters' menu in qvTrace.
%
% 'cellParameters' must have fields:
% 'Rs', 'Ri', 'Cm', 'tau'

% gs 2008 03 08
% --------------------------------------

% import from WS
try
    cellParameters = evalin('base', 'cellParameters');
catch
    disp(' ');
    disp('importCellParametersFromWS: Variables not found in WS. ');
    disp('Run qvTrace > Cell params > Calculate etc.');
end

% update gui values
set(handles.rseriesAvg, 'String', num2str(round(cellParameters.Rs)));
set(handles.rmembraneAvg, 'String', num2str(round(cellParameters.Ri)));
set(handles.cmembraneAvg, 'String', num2str(round(cellParameters.Cm)));
set(handles.tauAvg, 'String', num2str(cellParameters.tau));

% update handles variable
handles.data.map.mapAvg.rseriesAvg = cellParameters.Rs;
handles.data.map.mapAvg.rmembraneAvg = cellParameters.Ri;
handles.data.map.mapAvg.cmembraneAvg = cellParameters.Cm;
handles.data.map.mapAvg.tauAvg = cellParameters.tau;
